<?php
class info extends baseController {    
	public function __construct() {
		parent::__construct ();
	}
    
    public function loadView($temp) {
        if (!isset($temp["data"]))
            $temp["data"] = '';
        $this->load->view("template", $temp);
    }
    
    public function index() {
        $infos = $this->infoModel->get_by(array('languageCode' => $this->session->userdata('languageCode')));
        $this->_data["template"] = 'info';
        $this->_data["data"] = $infos;
        $this->loadView($this->_data);
    }
    
    public function view($slug) {
        $info = $this->infoModel->read(array('slug' => $slug, 'languageCode' => $this->session->userdata('languageCode')));
        $this->_data["template"] = 'info';
        $this->_data["data"] = $info;
        $this->loadView($this->_data);
    }
}
?>